# Insert a time/date variable

Use the Time Date dialog to insert a time and date variable in a text box. The time and date will change dynamically at run time.

For example, many developers like to put the system time and date on the main display. To do this, embed a time and date variable in a text string and link it to a system time tag. For example, the string "Current time is /*t*/" might display as Current time is 3:04:45 pm.

Tip: | Embedded variables are case sensitive, and must be in the proper format and syntax to work. If you make a mistake, your variable will be treated as a piece of text. Therefore, do not attempt to edit embedded variables manually. Use the Insert Variable and Edit variable dialog boxes to avoid problems.

## To set up a time/date variable

1. In the Caption box in a graphic object’s Properties dialog box, or in the Message column of the Local Messages, Information Messages, or Alarm Setup editor, click Insert Variable.
2. Click Time/Date.
3. Select an option from the drop-down list in the dialog box that opens.
4. Click OK.

## Options

From the drop-down list, select the time and date format to show.

Select this option from the list | To insert these characters | This format is called
29/11/2000 | SD | Short date
November 29, 2000 | LD | Long date
29/11/2000 3:39:03 PM | SDT | Short date and time
November 29, 2000 3:39:03 PM | LDT | Long date and time
3:39:03 PM | T | Time
3:39:03 PM 29/11/2000 | TSD | Time and short date
3:39:03 PM November 29, 2000 | TLD | Time and long date

Tip: | The time-and-date formats in the list will be shown in the language of the operating system as defined in the Regional Options tab of the Regional and Language Options dialog box in the Control Panel. The time and date will be shown in the current language of the application.

## See also

About embedded variables

Time-and-date variable syntax

Insert a numeric variable

Insert a string variable